home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Carousel Volume 2 #1
/
carousel.iso
/
mactosh
/
util
/
simulare.sit
/
Simula 4.07 Reference
/
card_34473.txt
< prev
next >
Wrap
Text File
|
1989-05-02
|
3KB
|
115 lines
-- card: 34473 from stack: in.07 Reference
-- bmap block id: 0
-- flags: 0000
-- background id: 13647
-- name:
-- part 1 (field)
-- low flags: 00
-- high flags: 0002
-- rect: left=341 top=105 right=165 bottom=476
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name:
-- part 2 (field)
-- low flags: 00
-- high flags: 0002
-- rect: left=341 top=168 right=269 bottom=475
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name:
-- part 3 (field)
-- low flags: 00
-- high flags: 0002
-- rect: left=319 top=52 right=101 bottom=387
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 0
-- font id: 3
-- text size: 9
-- style flags: 0
-- line height: 12
-- part name:
-- part 5 (button)
-- low flags: 00
-- high flags: 8002
-- rect: left=323 top=287 right=308 bottom=445
-- title width / last selected line: 0
-- icon id / first selected line: 0 / 0
-- text alignment: 1
-- font id: 0
-- text size: 12
-- style flags: 0
-- line height: 16
-- part name: Attribute access
----- HyperTalk script -----
on mouseUp
go to card id 36125
end mouseUp
-- part contents for background part 1
----- text -----
Pointers are used to access individual objects. Pointers
are typed (or qualified) to reference a special class of
objects. This means that it can point to objects of that
class and any of its sub-classes. Many of the qualification
checks can be done during compilation but in some cases
the check has to be done during run-time.
It is possible to test the qualification of an object
referenced by a pointer.
The "is" construct will answer the question if an object
is exactly of a specific qualification.
The "in" construct answers the question if an object
belongs to a class or any of its sub-classes.
-- part contents for background part 2
----- text -----
Typed object pointers
-- part contents for card part 1
----- text -----
pa :- new A; ! -- OK;
pb :- new B; ! -- OK;
pa :- new B; ! -- OK;
pb :- new A; ! -- WRONG --;
-- part contents for card part 2
----- text -----
pa:- new B;
pa is A -- false
pa is B -- true
pa in B -- true
pa in A -- Always true if
-- pa =/= none
-- part contents for card part 3
----- text -----
class A;;
A class B;;
ref(A) pa;
ref(B) pb;